package com.wiloon.java8x.thread.p0;

import com.wiloon.java8x.basic.Java8xUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by roy on 4/25/17;
 */
public class C0 {
    private static Logger logger = LoggerFactory.getLogger(C0.class);

    public static void main(String[] args) {
        logger.info("main start.");
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                while (true) {
//                    logger.info("running...");
//                }
//            }
//        });

        new Thread(() -> {
            //noinspection InfiniteLoopStatement
            while (true) {
                logger.info("t0 running...");
                try {
                    Thread.sleep(3 * 1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();

//        new Thread(() -> {
//            //noinspection InfiniteLoopStatement
//            while (true) {
//                logger.info("t1 running...");
//                try {
//                    Thread.sleep(3 * 1000);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//        }).start();

        Java8xUtils.pid();
        logger.info("main end.");
    }
}
